/**
 * Created by XianTao on 2015/1/23
 *
 * Copyright (c) 2015-2015
 * Apache License
 * Version 2.0, January 2004
 * http://www.apache.org/licenses/
 */
package com.taotao.wechat.game;

import com.taotao.admin.MyRopClient;
import com.taotao.wechat.message.resp.Article;
import com.taotao.wechat.message.resp.BaseMessage;
import com.taotao.wechat.message.resp.NewsMessage;
import com.taotao.wechat.util.MessageUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 公共事业缴费（水、电、燃气、有线电视）
 */
public class Wxcs extends Game {
    public static boolean IS_ENABLE = true;
    private static final String game_url_format = "/wxcs/index.html#pageHome?user=%s";

    public Wxcs() {
    }

    public Wxcs(BaseMessage baseMessage, String content, String appKey) {
        super(baseMessage, content, appKey);
    }

    @Override
    protected String getKeywords() {
        return "水费,电费,燃气,有线电视";
    }

    @Override
    protected String getKeyValue() {
        return "7";
    }

    @Override
    protected String gameUrl() {
        String url = MyRopClient.BASE_URL + String.format(game_url_format, appKey + ":" + baseMessage.getToUserName());
        NewsMessage newsMessage = new NewsMessage(baseMessage);
        newsMessage.setMsgType(MessageUtil.RESP_MESSAGE_TYPE_NEWS);
        newsMessage.setArticleCount(1);
        Article article = new Article();
        article.setDescription("简介：查询当前水、电、煤气、有线电视费，并可以查询近期使用情况，实现缴费提醒和网上缴费功能。");
        article.setPicUrl(MyRopClient.BASE_URL + "/wxcs/img/zt.jpg");
        article.setTitle("☆便民缴费☆");
        article.setUrl(url);
        List<Article> articles = new ArrayList<Article>();
        articles.add(article);
        newsMessage.setArticles(articles);
        return MessageUtil.newsMessageToXml(newsMessage);
    }

    @Override
    public String getAppIds() {
        return "wx940fdc566fac172a,wxbb9311109208320a";
    }

    @Override
    public String getMemberCode() {
        return null;
    }

    @Override
    public Integer getMemberStatus() {
        return null;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public String getNickName() {
        return null;
    }

    @Override
    public String getStartDate() {
        return null;
    }

    @Override
    public String getEndDate() {
        return null;
    }
}
